#ifndef RELAYBUTTON_H
#define RELAYBUTTON_H

#include <QPushButton>
#include "relayevent.h"

struct RelayData;

class RelayButton : public QPushButton
{
    Q_OBJECT
public:
    explicit RelayButton(RelayData *relayData, QWidget *parent = 0);
    ~RelayButton();

    virtual QSize sizeHint() const;

    void updateStatus();
    void updateMinute(int dayOfWeek, int hour, int minute);

    enum {
        DefWidth = 100, DefHeight = 100,
    };

protected:
    virtual void paintEvent(QPaintEvent *event);

private Q_SLOTS:
    void onAutoPush();
    void onShutDown();

private:
    QPixmap     m_pixmapBackground;
    QPixmap     m_pixmapStatus;

    RelayData   *m_pRelayData;
};

#endif // RELAYBUTTON_H
